# calculating method
def dayUP(df):
    dayup = 1
    for i in range(365):
        if i % 7 in [6, 0]:
            dayup = dayup * (1 - 0.01)
        else:
            dayup = dayup * (1 + df)
    return dayup

dayfactor = 0.01
while dayUP(dayfactor) < 1.01 ** 365:
    dayfactor += 0.00001
    # dayfactor += 0.001
print("工作日的努力参数是：{:.4f} ".format(dayfactor))

# mathematical method
week_num = 365 // 7
remaining_days = 365 % 7
dayfactor = (1.01 ** 365 / 0.99 ** (week_num * 2 + 2)) ** (1 / (week_num * 5 + remaining_days - 2)) - 1
print(f'dayfactor_1: {dayfactor}')
dayfactor = (1.01 ** 365 / 0.99 ** (week_num * 2 + 1)) ** (1 / (week_num * 5 + remaining_days - 1)) - 1
print(f'dayfactor_2: {dayfactor}')
